<template>
    <div class="hot_container">
        <div class="hot_header">
            <p>全民砍价</p>
            <img src="../../assets/箭头右.png" alt="">
        </div>
        <div class="hot_list_container">
            <div class="hot_item_container" 
            v-for="(item,index) in hotItems" :key="index"
            v-show="item.categoryId === 15119"
            @click="toDetails(item)">
                <img :src="item.pic" alt="">
                <div class="hot_item_title" v-html="item.name"></div>
                <p v-html="item.characteristic"></p>
                <div class="hot_item_price">￥{{item.minPrice}}</div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return {

        }
    },
    computed:{
        hotItems(){
            return this.$store.state.hotModules.hot
        },
    },
    methods:{
        toDetails(item){
            this.$store.dispatch('getDetails',item.id)
            this.$router.push('/details')
        }
    },
    mounted(){
        this.$store.dispatch('hotList')
    }
}
</script>

<style scoped>
    .hot_container {
      width: 100%;
    }
    .hot_header {
      width: 100%;
      height: 1rem;
      display: inline-flex;
      justify-content: center;
      align-items: center;
    }
    .hot_header p {
      font-size: 0.3rem;
    }
    .hot_header img {
        width: 0.25rem;
        margin-left: 0.06rem;
    }
    .hot_list_container {
        width: 100%;
        display: inline-flex;
        justify-content: space-around;
        align-content: flex-start;
        flex-wrap: wrap;
    }
    .hot_item_container {
        width: 45%;
        height: 5rem;
        background-color: #fff;
        margin-top: 0.2rem;
    }
    .hot_item_container img {
        width: 100%;
        height: 3.7rem;
        
    }
    .hot_item_title {
        width: 100%;
        height: 0.4rem;
        overflow:hidden;
        text-overflow:ellipsis;
        white-space:nowrap;
    }
    .hot_item_container p {
        overflow:hidden;
        text-overflow:ellipsis;
        white-space:nowrap;
        font-size: 0.2rem;
        color: gray;
    }
    .hot_item_price {
        color: red;
    }
</style>